{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第九讲：线性相关性、基、维数\n",
    "\n",
    "$v_1,\\ v_2,\\ \\cdots,\\ v_n$是$m\\times n$矩阵$A$的列向量：\n",
    "\n",
    "如果$A$零空间中有且仅有$0$向量，则各向量线性无关，$rank(A)=n$。\n",
    "\n",
    "如果存在非零向量$c$使得$Ac=0$，则存在线性相关向量，$rank(A)\\lt n$。\n",
    "\n",
    "向量空间$S$中的一组基（basis），具有两个性质：\n",
    "\n",
    "1. 他们线性无关；\n",
    "2. 他们可以生成$S$。\n",
    "\n",
    "对于向量空间$\\mathbb{R}^n$，如果$n$个向量组成的矩阵为可逆矩阵，则这$n$个向量为该空间的一组基，而数字$n$就是该空间的维数（dimension）。\n",
    "\n",
    "举例：\n",
    "$\n",
    "A=\n",
    "\\begin{bmatrix}\n",
    "1 & 2 & 3 & 1 \\\\\n",
    "1 & 1 & 2 & 1 \\\\\n",
    "1 & 2 & 3 & 1 \\\\\n",
    "\\end{bmatrix}\n",
    "$\n",
    "，A的列向量线性相关，其零空间中有非零向量，所以$rank(A)=2=主元存在的列数=列空间维数$。\n",
    "\n",
    "可以很容易的求得$Ax=0$的两个解，如\n",
    "$\n",
    "x_1=\n",
    "\\begin{bmatrix}\n",
    "-1 \\\\\n",
    "-1 \\\\\n",
    "1 \\\\\n",
    "0 \\\\\n",
    "\\end{bmatrix}, \n",
    "x_2=\n",
    "\\begin{bmatrix}\n",
    "-1 \\\\\n",
    "0 \\\\\n",
    "0 \\\\\n",
    "1 \\\\\n",
    "\\end{bmatrix}\n",
    "$，根据前几讲，我们知道特解的个数就是自由变量的个数，所以$n-rank(A)=2=自由变量存在的列数=零空间维数$\n",
    "\n",
    "我们得到：列空间维数$dim C(A)=rank(A)$，零空间维数$dim N(A)=n-rank(A)$"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
